﻿package com.everydayflash.away3d.earth {
	
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	import flash.display.Sprite;

	/**
	 * Additional class for the away3d demo presented here:
	 * http://www.everydayflash.com/blog/index.php/2008/04/26/light-shading-away3d/
	 * 
	 * Check the downloads section for a ZIP containg this class and the assest used (see above)
	 * http://code.google.com/p/barteksplayground/downloads/list
	 * 
	 * @author Bartek Drozdz [www.everydayflash.com]
	 */
	public class Instruction extends Sprite {
		
		private var info:TextField;
		private var copy:String = "<a href='http://www.everydayflash.com'>EverydayFlash.com</a> | Made with <a href='http://www.away3d.com'>Away3D</a> | Click: change view, Space: pause, Mouse wheel: zoom, Cursor keys: change simulation rate. View: ";
		
		public function Instruction() {
			info = new TextField();
			var format:TextFormat = new TextFormat();
			format.font = "Verdana";
            format.color = 0xaaaaaa;
            format.size = 9;
			info.defaultTextFormat = format;
			info.autoSize = TextFieldAutoSize.LEFT;
			info.wordWrap = false;
			info.selectable = false;
			
			addChild(info);
		}
		
		public function setViewName(vname:String):void {
			info.htmlText = copy + vname;
		}
	}
}